﻿<controls:ChildWindow x:Class="ChemProV.UI.OSBLE.LoginWin"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="300" Height="160" 
           Title="OSBLE Login" Closing="LoginWindowClosing">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition Height="31" />
            <RowDefinition Height="31"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="40" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <TextBlock Text="User Name:" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center"  />
        
        <TextBox x:Name="UserNameTextBox" Grid.Row="0" Grid.Column="1" Margin="3,3,3,3" KeyUp="UserNameTextBox_KeyUp"  />

        <TextBlock Text="Password:" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" />
        <PasswordBox 
            x:Name="PasswordBox" 
            Grid.Row="1" 
            Grid.Column="1" 
            Margin="3,3,3,3" 
            KeyUp="PasswordBox_KeyUp"
            />
        <CheckBox x:Name="RememberCredentialsCheckBox" Grid.Row="2" Grid.Column="1" Margin="3,3,3,3">Remember Me</CheckBox>

        <TextBlock x:Name="ErrorTextBlock" Grid.Row="2" Grid.RowSpan="2" Grid.Column="0" TextWrapping="Wrap" Foreground="Red"
            Visibility="Collapsed"/>
        <Button 
            x:Name="OKButton" 
            Content="Login"
            Width="75"
            Height="23" 
            HorizontalAlignment="Right" 
            Grid.Row="3" 
            Grid.Column="1" 
            Click="OKButton_Click" />

        <!-- Progress bar that gets shown as we are doing the async web calls -->
        <ProgressBar
            x:Name="LoadingProgressBar"
            Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
            Visibility="Collapsed"
            IsIndeterminate="True"
            Height="30" />
    </Grid>
</controls:ChildWindow>